function loginyz(){
	function setCookie(key,value,day){
		var date=new Date();//创建日期对象
		date.setDate(date.getDate()+day);//过期时间：获取当前的日期+天数，设置给date
		document.cookie=key+'='+encodeURI(value)+';expires='+date;//添加cookie，设置过期时间
	}

	$('#user-sub').click(function(){
		var $username=$('#user').val();
		var $password=$('#word').val();
		$.ajax({
			type:"post",
			url:"http://www.qialapapa.online/api/login.php",
			data: {
				name:$username,
				pass:$password
			},
			success: function(data){
				if(!data){
					$('#user-verify').css({'color':'red','fontWeight':'bold','fontSize':'14px'}).html('您的用户名不存在或者密码错误，请重新输入!!!');
				}else{//匹配成功进行页面跳转
					window.location.href='http://127.0.0.1/music-server/src/html/index.html?_k=yxdklz#/list';//跳转
					setCookie('UserName',$username,3600*24*7);
				}
			}
		});
	});
}

export default loginyz;